#! /bin/csh -f

if ( "$1" == "" ) then
  echo "Usage: psrhelp [options]"
  echo "All options are passed to grep"
  exit -1
endif

set programs = "vap pav psredit psrtxt psrconv vip pam pascii pat paz psradd psrsh psrwt fluxcal pac pcm psrplot pas psrdiff pacv"

foreach prog ( $programs )

  $prog -h |& grep $* | grep -v ': invalid' | awk -vp=$prog '{print p": "$0}'
  $prog -H |& grep $* | grep -v ': invalid' | awk -vp=$prog '{print p": "$0}'
  $prog --help |& grep $* | grep -v ': invalid' | awk -vp=$prog '{print p": "$0}'

end

